﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
    <link href="../CSS/style1.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/style4.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.showModalDialog.js" type="text/javascript"></script>
    <script type="text/javascript">
        function xiao() {
            $("#tab tr:gt(0)").live("click", function () {
                
                $("#dataLeft .dataTable tr:gt(0)").css("background-color", "white");
                $(this).css("background-color", "yellow");
                
            });
        }
        function showEdit(id) {
            $.showModalDialog("rolePowerDialog.htm", { id: id }, 600, 500, function (r) {
                Load();
            });
        }

        $(function () {
            xiao();
            Load();
        })
        //用于刷新的
        function Load() {
            $.ajax({
                url: "roleManager.asmx/SelectRole",
                type: "post",
                data: JSON.stringify({}),
                dataType: "json",
                contentType: "application/json",
                success: function (obj) {
                    var data = obj.d;
                    $("#tab tr:gt(0)").remove();
                    var tab = $("#tab").get(0);
                    for (var i = 0; i < data.length; i++) {
                        var tr = tab.insertRow(-1);
                        tr.insertCell(-1).innerHTML = data[i].ID;
                        tr.insertCell(-1).innerHTML = data[i].RoleName;
                        tr.insertCell(-1).innerHTML = "<img title='设置权限' src='../images/33.gif' onclick='showEdit(" + data[i].ID + ");' />";
                    }

                }, error: function (xmlhttp) {
                    alert("错误：" + xmlhttp.responseText);
                }
            });
        }
    </script>
</head>
<body>
<div id="desDiv">
    <span>角色权限管理</span><br />
    维护系统中的角色所拥有的权限
</div>
<div id="dataDiv">
    <div id="headDiv">
        &nbsp;
    </div>
    <div id="dataLeft">
        <table class="dataTable" id="tab">
        <tr>
            <th width="80">角色编号</th>
            <th>角色名称</th>
            <th>设置权限</th>
        </tr>
    </table>
    </div>
    <div id="pageDiv">
        &nbsp;
    </div>
</div>
</body>
</html>
